package com.zbkj.admin.model.req;

import com.zbkj.dal.annotation.StringContains;
import com.zbkj.dal.pojo.request.UserOperateBalanceRequest;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.*;
import java.math.BigDecimal;

@Data
@ApiModel
public class UserOperateQuotaReq {

    @ApiModelProperty(value = "额度类型，TOTAL=等级计算额度，AVAILABLE=可用", required = true)
    @NotBlank(message = "请选择额度类型")
    @StringContains(limitValues = {"TOTAL", "AVAILABLE"}, message = "未知额度类型")
    private String quotaType;

    @ApiModelProperty(value = "uid", required = true)
    @NotNull(message = "请选择用户")
    @Min(value = 1, message = "请输入正确的uid")
    private Integer uid;

    @ApiModelProperty(value = "操作类型， add=增加，sub=减少", required = true)
    @NotBlank(message = "请选择操作类型")
    @StringContains(limitValues = {"add", "sub"}, message = "未知的操作类型")
    private String operateType;

    @ApiModelProperty(value = "金额", required = true)
    @NotNull(message = "金额不能为空")
    @DecimalMin(value = "0.01", message = "金额最小为0.01")
    @DecimalMax(value = "99999999.99", message = "金额最大为99999999.99")
    private BigDecimal money;

    @ApiModelProperty(value = "备注", required = true)
    @NotBlank(message = "备注不能为空")
    private String remark;
}
